.TH std::chrono::year 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::chrono::year \- std::chrono::year

.SH Synopsis
   Defined in header <chrono>
   class year;                 \fI(since C++20)\fP

   The class year represents a year in the proleptic Gregorian calendar. Its range is
   [-32767, 32767].

   year is a TriviallyCopyable StandardLayoutType.

.SH Member functions

   constructor     constructs a year
                   \fI(public member function)\fP
   operator++
   operator++(int) increments or decrements the year
   operator--      \fI(public member function)\fP
   operator--(int)
   operator+=      adds or subtracts a number of years from a year
   operator-=      \fI(public member function)\fP
   operator+       applies unary operators to year
   operator-       \fI(public member function)\fP
   is_leap         determines if the year is a leap year
                   \fI(public member function)\fP
   operator int    retrieve the year value
                   \fI(public member function)\fP
   ok              checks if the stored year value is valid
                   \fI(public member function)\fP
   min             returns the smallest possible year value
   \fB[static]\fP        \fI(public static member function)\fP
   max             returns the largest possible year
   \fB[static]\fP        \fI(public static member function)\fP

.SH Non-member functions

   operator==  compares two year values
   operator<=> \fI(function)\fP
   (C++20)
   operator+   performs arithmetic on years
   operator-   \fI(function)\fP
   (C++20)
   operator<<  outputs a year into a stream
   (C++20)     \fI(function template)\fP
   from_stream parses a year from a stream according to the provided format
   (C++20)     \fI(function template)\fP

.SH Helper classes

   std::formatter<std::chrono::year> formatting support for year
   (C++20)                           \fI(class template specialization)\fP
   std::hash<std::chrono::year>      hash support for std::chrono::year
   (C++26)                           \fI(class template specialization)\fP

.SH Literals

   Defined in inline namespace std::literals::chrono_literals
   operator""y  a std::chrono::year literal representing a particular year
   (C++20)      \fI(function)\fP
